|
|
 |
|
|
|
|
window_style = (window_style Or WS_CHILD)
' Set the window's new style. SetWindowLong frmCover.hwnd, _
GWL_STYLE, window_style
' Get the preview area hWnd. preview_hwnd = GetHwndFromCommand(args)
' Set the window's parent so it appears
' inside the preview area. SetParent frmCover.hwnd, preview_hwnd
' Save the preview area's hWnd in
' the form's window structure. SetWindowLong frmCover.hwnd, _
GWL_HWNDPARENT, preview_hwnd
' Get the dimensions of the preview area. GetClientRect preview_hwnd, preview_rect
' Show the preview. SetWindowPos frmCover.hwnd, _
HWND_TOP, 0&, 0&, _
preview_rect.Right, _
preview_rect.Bottom, _
SWP_NOZORDER Or SWP_NOACTIVATE Or _
SWP_SHOWWINDOW
End Select
End Sub |
|
|
|
|
|
|
|
|
Screen savers must handle a few other details that are much less confusing. To protect the screen as completely as possible, make the program run maximized with no title bar. Set the form's background color to black to reduce the chances of burning the screen phosphors. You can complete these steps by setting the main form's property values as shown in Table 9.1. |
|
|
|
|
| Table 9.1 Main Form Property Values for Screen Savers |  |
|
|
|
|
PROPERTY |
|
|
|
| VALUE |  |
|
|
|
|
BackColor |
|
|
|
| &H00000000 |  |
|
|
|
|
Caption |
|
|
|
| " " |  |
|
|
|
|
ControlBox |
|
|
|
| False |  |
|
|
|
|
MaxButton |
|
|
|
| False |  |
|
|
|
|
MinButton |
|
|
|
| False |  |
|
|
|
|
WindowState |
|
|
|
| 2 - maximized |
|
|
|